package com.tj.collection.enums;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WatsonQiu
 * Date: 2017/7/26
 * Time: 下午7:43
 */
public enum ChannelCodeEnums {

    APP("App", "App"),
    XYLD("Xyld", "Xyld"),
    H5("h5", "h5"),
    RONG360("rong360", "融360"),
    FQGJ("fqgj", "fqgj");

    private String type;
    private String desc;

    ChannelCodeEnums(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public ChannelCodeEnums setType(String type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public ChannelCodeEnums setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static ChannelCodeEnums getEnumByType(String type) {
        ChannelCodeEnums productTypeEnums = null;
        for (ChannelCodeEnums enums : ChannelCodeEnums.values()) {
            if (enums.getType().equals(type)) {
                productTypeEnums = enums;
            }
        }
        return productTypeEnums;
    }
}
